{% load pp_url %}


<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}"
    xml:lang="{% firstof LANGUAGE_CODE 'en' %}"
    lang="{% firstof LANGUAGE_CODE 'en' %}">
  <head>
    
    <title>{{request.path|cut:"/"|cut:".html"|capfirst}} - Nonrel-testapp</title>


    <link rel="stylesheet" type="text/css" href="/static/main.css" />
    {% block css %}
    {% endblock %}

    <script type="text/javascript" src="/static/jquery-1.4.2.min.js"></script>

    <script type="text/javascript">

        function changeText(text,div_id)
        {
         elem = document.getElementById(div_id);
         elem.innerHTML = text;
        };

        function changeImgSrc(text,div_id)
        {
         elem = document.getElementById(div_id);
         elem.src = text;
        };
     
        function upvote(idk,div_id,img_id){ 
        $.post("/vote/", {vote: "up", pk: idk },
          function(data) {
              if(data.FAIL != true){
                  changeImgSrc(data.imgsrc,img_id);
                  changeText(data.count,div_id);
              }
         }, "json");
        };
            function downvote(idk,div_id,img_id){ 
            $.post("/vote/", {vote: "down", pk: idk },
              function(data) {
              if(data.FAIL != true){
                  changeImgSrc(data.imgsrc,img_id);
                  changeText(data.count,div_id);
              }
             }, "json");
            };
        function neutvote(idk,div_id,img_id){ 
        $.post("/vote/", {vote: "neut", pk: idk },
          function(data) {
              if(data.FAIL != true){
                  changeImgSrc(data.imgsrc,img_id);
                  changeText(data.count,div_id);
              }
         }, "json");
        };

    </script>

    {% block js %}

    {% endblock %}

    {% block extra-head %}{% endblock %}
  </head>


  <body>
    <div id="header">
        <h2>Pirate Politics</h2>
        <div id = "titleBar">
            <span class = "userInfo">
            {% if username %}
                {{username|default:"No Username"}} ({{repScore|default:"1"}}) | <a href="/account">My Account</a>
            {% else %}
                <a href="/login.html">Login</a>
            {% endif %}
            </span>
        </div>
        
        <div id = "navBox">
            <ul id = "nav">
                <li><a href="#">Home</a>
                    <ul><li><a href="/home.html">Homepage</a></li></ul>
                </li>
            
                <li><a href="#">Testing Pages</a>
                    <ul><li><a href="/helloworld.html">Hello World</a></li></ul>
                    <ul><li><a href="/generate_vote_content/">Generate Test Content</a></li></ul>
                </li>
            
                <li><a href="#">Useful Pages</a>
                    <ul><li><a href="/topics.html">Topics</a></li>
                        <li><a href="{% pp_url template="issues.html" %}">Issues</a></li>
                        <li><a href="/hot.html">Hot Issues</a></li>
                        <li><a href="/cont.html">Controversial Issues</a></li>
                        <li><a href="/permgroups.html">Permission Groups</a></li></ul>
                </li>
            
                <li><a href="#">Templates</a>
                    <ul><li><a href="/base.html">Base</a></li>
                        <li><a href="/session.html">Session</a></li></ul>
                </li>
                <li><a href="#">Internal Pages</a>
                    <ul><li><a href="/404.html">404 Error</a></li>
                    <li><a href="/500.html">500 Error</a></li></ul>
                </li>
            </ul>
            
            <strong>{% block title %}Unnamed page{% endblock %}</strong>
        </div>
    </div>
    
    
      <div id="mainContent">
        {% block content-header %}
          {% if error %}<div class="error">{{ error }}</div>{% endif %}
          {% if info %}<div class="info">{{ info }}</div>{% endif %}
          {% if messages %}
            {% for message in messages %}
              <div class="info">{{ message }}</div>
            {% endfor %}
          {% endif %}
        {% endblock %}
        
        {% block content %}Default content{% endblock %}
      </div>

    <div id="footer">
      <p>Copyright {% now "Y" %} the author</p>
    </div>
  </body>
</html>
